package cn.tlb.ui.widget;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.webkit.JavascriptInterface;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class UserProtocolActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        WebView webView = new WebView(this);
        webView.getSettings().setJavaScriptEnabled(true);
        webView.addJavascriptInterface(this, "UserProtocolActivity");
        webView.setWebViewClient(new WebViewClient());
        setContentView(webView);
        //webView.loadUrl("file:///android_asset/user-protocol.html");
        webView.loadUrl("http://192.168.47.146:8080/http/protocol/user.html");
    }

    @JavascriptInterface
    @Override
    public void finish() {
        super.finish();
    }
}
